package com.hfmall.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
public class UtilPageGoodsinfoVO<T> {
    /**
     * 选择的规格值String[]
     */
  private List<String> classValue;
    /**
     * 选择的分类id
     */
  private Integer  categoryId;
  private BigDecimal priceMax;
  private BigDecimal priceMix;
    /**
     * 页码
     */
  private Integer page;
   private List<Integer> pages;
  /**
   * 总的页数
   */
  private Integer allPage;
    /**
     * 每页个数
     */
  private Integer size;
  /**
   * 总的数据条数
   */
  private Integer conSize;

  /**
   * 返回数据
   */
  private List<T> dataVO;
  public UtilPageGoodsinfoVO(){
    this.addPages();
  }

  private  void addPages(){
    this.pages=new ArrayList<>();
    if(this.allPage!=null && this.allPage >0) {
      for (int i = 1; i <= allPage; i++) {
        this.pages.add(i);
      }
    }else {
      this.pages.add(1);
    }
    if(this.page==null){
      this.page=1;
    }
  }
}
